// 项目中我们大多数时候都会把对应的接口请求封装成api来调用
import myaxios from '@/util/axios.js'
import qs from 'qs'

// 登录接口
export function login(data) {
    return myaxios({
        method: 'post',
        url: '/login',
        data
    })
}

// 学生列表查询接口
export function students(params) {
    return myaxios({
        method: 'get',
        url: '/students',
        params
    })
}
//删除学生
export function delstuent(id) {
    return myaxios({
        method: 'delete',
        url: `/students/:${id}`
    })
}
//获取信息列表
export function getTable(){
    return myaxios({
        method: 'get',
        url: '/info',
    })
}

//信息列表新增
export function addTable(data){
    data = qs.stringify(data)
    return myaxios({
        method: 'post',
        url: '/info',
        data
    })
}

//信息列表删除
export function delTable(id){
    return myaxios({
        method: 'delete',
        url: `/info/:${id}`,
    })
}

//修改信息
export function editTable(params){
    return myaxios({
        method: 'put',
        url: '/info',
        params
    })
}